<template>
	<view>



		<z-paging ref="paging" v-model="teacherList" @query="queryList" >
			<view style="padding-left: 20px;padding-right: 20px; margin-top: 20px;">
				<u-row>
					<u-col :span="8">
						<u-input placeholder="请输入老师名称"></u-input>
					</u-col>
					<u-col :span="4">
						<view style="margin-left: 20px;">
							<u-button icon="search" text="搜索"></u-button>
						</view>

					</u-col>
				</u-row>
				<u-divider></u-divider>
			</view>

			<view class="item" v-for="(item,index) in teacherList" @click="itemClick(item)">
				<u-image :src="item.avatar" width="80px" height="80px"></u-image>
				<view style="margin-left: 20px;">{{item.name}}</view>

			</view>

		</z-paging>









	</view>
</template>

<script>
	export default {
		data() {
			return {
				teacherList: []
			}
		},
		methods: {
			itemClick(item){
				console.log(item)
				var id=item.id
				uni.navigateTo({
				  url: '/pages/teacherDetail/teacherDetail?id='+id
				});
			},
			queryList(pageNo, pageSize) {
				console.log(pageNo)
				console.log(pageSize)
				for (var i = 0; i < pageSize; i++) {
					this.teacherList.push({
						id: i,
						name: '老师测试' + i,
						avatar: '/static/avatar/touxiang1.jpg'
					})
				}

			},
			
		}
	}
</script>

<style>
	.item {
		display: flex;
		padding-left: 10px;
		padding-right: 10px;
		padding-top: 10px;
		padding-bottom: 20px;
		align-items: center;

	}
</style>